package org.JQbitorrentClinet.pojo.torrent;

import lombok.Data;

import java.util.Arrays;
import java.util.List;

@Data
public class TorrentInfo {
    Long added_on;
    Long amount_left;
    Boolean auto_tmm;
    Float availability;
    String category;
    Long completed;
    Long completion_on;
    String content_path;
    Long dl_limit;
    Long dlspeed;
    String download_path;
    Long downloaded;
    Long downloaded_session;
    Long eta;
    Boolean f_l_piece_prio;
    Boolean force_start;
    String hash;
    Integer inactive_seeding_time_limit;
    String infohash_v1;
    String infohash_v2;
    Long last_activity;
    String magnet_uri;
    Integer max_inactive_seeding_time;
    Float max_ratio;
    Integer max_seeding_time;
    String name;
    Integer num_complete;
    Integer num_incomplete;
    Integer num_leechs;
    Integer num_seeds;
    Integer priority;
    Float progress;
    Float ratio;
    Float ratio_limit;
    String save_path;
    Integer seeding_time;
    Integer seeding_time_limit;
    Long seen_complete;
    Boolean seq_dl;
    Long size;
    String state;
    Boolean super_seeding;
    String tags;
    Long time_active;
    Long total_size;
    String tracker;
    Integer trackers_count;
    Long up_limit;
    Long uploaded;
    Long uploaded_session;
    Long upspeed;

    public List<String> getTags(){
        if(tags == null || tags.isEmpty()){
            return Arrays.asList();
        }
        return Arrays.asList(tags.split(", "));
    }
}
